package com.lance.service;

import com.lance.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author lancecong
 * @version 1.0
 * @ClassName
 * @DESCRIPTION TODO
 * @create2019/1/6
 **/
//@FeignClient(name = "zc-provider" ,url = "https://api.github.com" )
@FeignClient(name = "zc-provider")
//        ,fallback = FeignService.HystrixClientFallback.class)
public interface FeignService {

    @RequestMapping(value = "/search/repositories", method = RequestMethod.GET)
    public String searchRepos(@RequestParam("q") String q);


    @GetMapping("/add/user")
    public String addUser(User user);


    @PostMapping("/update/user")
    public String updateuser(User user);

//    static class HystrixClientFallback implements HystrixClient {
//        @Override
//        public String iFailSometimes() {
//            return "fallback";
//        }
//    }
}
